<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>销售统计分析报表</title>
		<link href="../common/css/style1.css" rel="stylesheet" type="text/css" />
		<link href="../common/css/ui.jqgrid.css" rel="stylesheet"
			type="text/css" />
		<link href="../common/js/dp/css/jquery-ui-1.8.6.custom.css"
			rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../common/js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="../common/js/jquery-ui.js"></script>
		<script type="text/javascript" src="../common/js/common.js"></script>
		<script type="text/javascript"
			src="../common/js/dp/js/jquery-ui-timepicker-addon.js"></script>
		<script type="text/javascript"
			src="../common/js/dp/js/ui.datepicker-zh-cn.js"></script>
		<script type="text/javascript" src="../common/js/datetime.js"></script>
		<script src="../common/js/jquery.fileDownload.js"></script>
		<script src="../common/js/view/salesAnalysis_report_week_search.js"></script>

		<script type="text/javascript">
        function ShowMenu(id) {
            var className = document.getElementById('menu' + id).className;
            if(className.indexOf('curr')==-1)
                document.getElementById('menu' + id).className = 'mouseover';
            else
                document.getElementById('menu' + id).className = 'curr mouseover';
            document.getElementById('ul'+id).style.display = 'block';
        }
        function HideMenu(id) {
            var className = document.getElementById('menu' + id).className;
            if (className.indexOf('curr') == -1)
                document.getElementById('menu' + id).className = '';
            else
                document.getElementById('menu' + id).className = 'curr';
            document.getElementById('ul' + id).style.display = 'none';
        }
        var oldOld = null;
        function ShowMenuDd(obj) {
            if (oldOld == obj) return;
            if (oldOld != null) {
                oldOld.className = '';
            }
            obj.className = 'visible';
            oldOld = obj;
        }

        var speed3 = 10; //速度数值越大速度越慢
        var maxWidth = 0;
        window.onload = function () {
            maxWidth = document.getElementById("divScrollCommend").scrollWidth;
            document.getElementById("tdScroll2").innerHTML = document.getElementById("tdScroll1").innerHTML;
            var MyMar = setInterval(Marquee, speed3);
            document.getElementById("divScrollCommend").onmouseover = function () { clearInterval(MyMar) }
            document.getElementById("divScrollCommend").onmouseout = function () { MyMar = setInterval(Marquee, speed3) }
        }

        function Marquee() {
            var left = parseInt(document.getElementById("divScrollCommend").style.left);
            if (left + maxWidth == 0) {
                left = 0;
            }
            else {
                left--;
            }
            document.getElementById("divScrollCommend").style.left = left + 'px';
        }
        function query(){
        	var datas = {fun:'query',date_type:getRadioVal('time')};
        	var oDate = $('#date_range');
			oDate.val($.trim(oDate.val()));
			var tok = oDate.val().split(' ~ ');
			if(oDate.val()==''){
				alert('请输入期间');oDate.focus();return;
			}else if((tok.length!=2 || !isDateStr(tok[0]) || !isDateStr(tok[1]))){
				alert('日期有误');oDate.focus();return;
			}else if(compareDateStr(tok[0], tok[1])<0){
				alert('结束日期应大于开始日期');oDate.focus();return;
			}else if(datas['date_type']=='udf' && !isDateStr($('#begin_time').val())){
				alert('开始日期有误');$('#begin_time').focus();return;
			}else if(datas['date_type']=='udf' && !isDateStr($('#end_time').val())){
				alert('结束日期有误');$('#end_time').focus();return;
			}else if(datas['date_type']=='udf' && compareDateStr($('#begin_time').val(), $('#end_time').val())<0){
				alert('结束日期应大于开始日期');$('#end_time').focus();return;
			}
			var beginTime = $("#beginTime").val(tok[0]).val();
			var endTime = $("#endTime").val(tok[1]).val();
			var dateType = $("#timeType").val(getRadioVal("time")).val();
			document.location.href='<%=basePath%>data/excel_export!exportSalesReport.action?dateType='+dateType+'&beginTime='+beginTime+'&endTime='+endTime;
        }
        
        function exportCountsReport(){
			var chooseTime = $("#chooseTime").val();
			var dateType = $('input[name=dateType]:checked').val();
			var beginTime =  $("#chooseBeginTime").val();
			var endTime =  $("#chooseEndTime").val();
			if(dateType=='brand'||dateType=='productyears'){
				if(beginTime==''||endTime==''){
					alert('请选择时间段');
					return;
				}
			}else{
				beginTime=chooseTime;
				endTime=chooseTime;
				if(chooseTime==''){
					alert('请选择时间');
					return;
				}
			}
			if(dateType=='networkio'){
				document.location.href='<%=basePath%>data/excel_export!exportNetworkioReport.action?dateType='+dateType+'&beginTime='+beginTime+'&endTime='+endTime;
			}else if(dateType=='brand'){
				document.location.href='<%=basePath%>data/excel_export!exportBrandReport.action?dateType='+dateType+'&beginTime='+beginTime+'&endTime='+endTime;
			}else if(dateType=='productyears'){
				document.location.href='<%=basePath%>data/excel_export!exportProductyearsReport.action?dateType='+dateType+'&beginTime='+beginTime+'&endTime='+endTime;
			}else if(dateType=='itemsalerank'){
				document.location.href='<%=basePath%>data/excel_export!exportItemsalerankReport.action?dateType='+dateType+'&beginTime='+beginTime+'&endTime='+endTime;
			}
		}
		
		function showTimeArea(dateType){
			if(dateType=='brand'||dateType=='productyears'){
				document.getElementById("customTimeArea").style.display='';
				document.getElementById("chooseTimeArea").style.display='none';
			}else{
				document.getElementById("customTimeArea").style.display='none';
				document.getElementById("chooseTimeArea").style.display='';
			}
		}
    </script>

	</head>
	<body>
		<form id="myForm" action="../../data/excel_export!export.action">
			<input name="beginTime" id="beginTime" type="hidden" value="" />
			<input name="endTime" id="endTime" type="hidden" value="" />
			<input name="timeType" id="timeType" type="hidden" value="" />
		</form>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td>
					<div class="Headerout1">
						<div class="Footerout2">
							<div class="Wrapper">
								<div align="right" style="padding-top: 20px">
									用户名: Admin
									<a href="http://localhost:8080/yalu/loginServlet?fun=out">注销</a>
								</div>
								<div align="left" style="padding-top: 20px">
									<img alt="" title="" src="../common/images/logo.jpg" />
								</div>
								<div>
									<strong><font size="5px">电子商务报表分析平台</font> </strong>
								</div>
								<div class="top-border" style="padding-top: 50px">
									<div
										style="width: 100%; position: absolute; bottom: 0; left: 0;">
										<div class="menu-border">
											<div class="menu-m">
												<a href="###" title="平台管理" id="menuAboutUs"
													onmouseover="ShowMenu('AboutUs')"
													onmouseout="HideMenu('AboutUs')">平台管理</a>
												<a href="###" title="报表功能" style="width: 120px;"
													id="menuSolution" onmouseover="ShowMenu('Solution')"
													onmouseout="HideMenu('Solution')">报表功能</a>
												<a href="###" title="系统管理" id="menuService"
													onmouseover="ShowMenu('Service')"
													onmouseout="HideMenu('Service')">系统管理</a>
											</div>
										</div>
									</div>
								</div>
								<div class="menu-popup">

									<ul id="ulAboutUs" onmouseover="ShowMenu('AboutUs')"
										onmouseout="HideMenu('AboutUs')"
										style="left: 15px; width: 120px;">

										<li>
											<a href="../../data/excel_import!index.action" title="量子数据">量子数据</a>
										</li>
										<li>
											<a href="###" title="店铺属性">店铺属性</a>
										</li>
										<li>
											<a href="###" title="销售成本/任务成本">销售成本/任务成本</a>
										</li>
										<li>
											<a href="###" title="入仓销售">入仓销售</a>
										</li>
										<li>
											<a href="###" title="运费">运费</a>
										</li>
										<li>
											<a href="###" title="退货原因">退货原因</a>
										</li>
										<li>
											<a href="###" title="仓库辖区">仓库辖区</a>
										</li>
										<li>
											<a href="###" title="快递公司">快递公司</a>
										</li>
										<li>
											<a href="###" title="店铺属性参数">店铺属性参数</a>
										</li>
									</ul>
									<ul id="ulSolution" onmouseover="ShowMenu('Solution')"
										onmouseout="HideMenu('Solution')"
										style="left: 117px; width: 120px;">
										<li>
											<a href="<%=basePath%>template/data/dailySales_search.jsp"
												title="每日报表">每日报表</a>
										</li>
										<li>
											<a href="<%=basePath%>template/data/Report.jsp" title="销售统计">销售统计</a>
										</li>
										<li>
											<a href="<%=basePath%>template/data/countsReport.jsp"
												title="多样统计">多样统计</a>
										</li>
										<li>
											<a href="###" title="退货分析">退货分析 </a>
										</li>
										<li>
											<a href="###" title="发货分析">发货分析</a>
										</li>
									</ul>
									<ul id="ulService" onmouseover="ShowMenu('Service')"
										onmouseout="HideMenu('Service')" style="left: 239px;">
										<li>
											<a href="dailySales_search.html" title="账号管理">账号管理</a>
										</li>
										<li>
											<a href="###" title="权限群组">权限群组</a>
										</li>
									</ul>

								</div>
								<div class="Container">
									<table class="tabs">
										<tbody>
											<!--tr style="text-align:left">
                                                <td>
                                                    <ul>
                                                        <li><a href="dailySales_search.html">店铺销售报表</a></li>
                                                    </ul>

                                                </td>
                                            </tr-->
										</tbody>
									</table>
									<div class="inquiry_box">
										<table width="100%" border="0" cellpadding="0" cellspacing="0">
											<tbody align="left">
												<tr>
													<td width="20%">
														<strong>请选择以下统计分析报表</strong>
													</td>
													<td>
														<input type="button" class="buttonA"
															onclick="exportCountsReport()" value="生成报表" />
													</td>
												</tr>
												<tr class="period" id="weekRadio" style="display: ">
													<td width="33%">
														<input id="" type="radio" checked="checked"
															value="networkio" name="dateType" checked="checked"
															onclick="showTimeArea('networkio')" />
														流量分析-分平台自营店
													</td>
													<td width="33%">
														<input id="dateType" type="radio" value="brand"
															name="dateType" onclick="showTimeArea('brand')" />
														品牌分析
													</td>
													<td width="33%">
														<input id="dateType" type="radio" value="productyears"
															name="dateType" onclick="showTimeArea('productyears')" />
														货品年份分析
													</td>
													<td>
													</td>
												</tr>
												<tr class="period" id="weekRadio" style="display: ">
													<td width="33%">
														<input id="dateType" type="radio" value="itemsalerank"
															name="dateType" onclick="showTimeArea('itemsalerank')" />
														销售分析-货号销售排名
													</td>
													<td width="33%">
													
													</td>
													<td width="33%">
														
													</td>
													<td>
													</td>
												</tr>
												<tr id="chooseTimeArea">
													<td colspan="3" align="center">
														选择日期：
														<input name="chooseTime" id="chooseTime" type="text"
															value="" class="fromDate" />
													</td>
												</tr>
												<tr id="customTimeArea" style="display: none">
													<td colspan="2">
														开始日期：
														<input name="chooseBeginTime" id="chooseBeginTime"
															type="text" value="" class="fromDate" />
													</td>
													<td colspan="2">
														结束日期：
														<input name="chooseEndTime" id="chooseEndTime" type="text"
															value="" class="toDate" />
													</td>
												</tr>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
		<br />
		<div class="wrapdown">
			<div class="footer">
				<script type="text/javascript" src="../common/layout/footer.js"></script>
			</div>
		</div>

	</body>
</html>


